﻿using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;

namespace RoslynScriptDemo
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var http = new HttpClient();
            var state = await CSharpScript.RunAsync("""
                var res = await GetStringAsync("https://www.baidu.com");
                Console.WriteLine(res);
                """, 
                globals: http,
                options: ScriptOptions.Default.WithImports("System"));
            //await state.ContinueWithAsync("Console.WriteLine(\"hello world.\");");
            Console.ReadKey();
        }
    }
}
